/*
 * lifegame.h
 *
 *  Created on: 2020.6.1
 *      Author: longhe
 */
#ifndef LIFEGAME_H_
#define LIFEGAME_H_

#include <stdio.h>


struct _LifeGame_T{
	const unsigned char w,h;
	char bit;
	char **data;
};
typedef struct _LifeGame_T LifeGame_T;

// create struct and allocate memory
// @rate is birth rate
LifeGame_T lg_new(unsigned char width, unsigned char height, unsigned char rate);

// evolution
void lg_evolution(LifeGame_T *lg);
// check status
char lg_live(LifeGame_T *lg, unsigned char i, unsigned char j);
//clean memory
void lg_clean(LifeGame_T *lg);


#endif /* LIFEGAME_H_ */
